/* 
 */

package com.uhaou.system.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import java.util.*;

import org.apache.commons.lang.StringUtils;
 

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;
 
import com.uhaou.common.base.*;
import com.uhaou.system.dao.ISysUserDao;
import com.uhaou.system.model.SysFunction;
import com.uhaou.system.model.SysRoleAssign;
import com.uhaou.system.model.SysUser;
import com.uhaou.system.service.ISysUserManager;
import com.uhaou.system.vo.query.SysUserQuery;

/**
 * @author  jiangcheng
 * @version 1.0
 * @since 1.0
 */


@Service("sysUserManager")
@Transactional
public class SysUserManagerImpl extends BaseManager<SysUser,java.lang.String> implements ISysUserManager{

	private ISysUserDao sysUserDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setSysUserDao(ISysUserDao dao) {
		this.sysUserDao = dao;
	}
	public EntityDao getEntityDao() {
		return (EntityDao)this.sysUserDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(SysUserQuery query) {
		return sysUserDao.findPage(query);
	}
	@Transactional(readOnly=true)
	public SysUser getById(java.lang.String id){
		return sysUserDao.getById( id);
	}
	@Transactional
	public void removeById(java.lang.String id){
		//修改原来的物理删除方法，改成逻辑删除
		SysUser entity = this.getById(id);
		entity.setDeleted("1");
		sysUserDao.update(entity);
		
		//super.removeById(id);
	}
	
	/** 插入数据 */
	@Transactional
	public void save(SysUser entity){
		sysUserDao.save(entity);
	}
	
	/** 更新数据 */
	@Transactional
	public void update(SysUser entity){
		sysUserDao.update(entity);
	}
	@Transactional(readOnly=true)
	public boolean isUnique(SysUser entity, String uniquePropertyNames){
		return sysUserDao.isUnique( entity, uniquePropertyNames);
	}
	@Transactional(readOnly=true)
	public List<SysUser> findAll(){
		return sysUserDao.findAll();
	}
	@Transactional
	public void saveOrUpdate(SysUser entity) {
		sysUserDao.saveOrUpdate(entity);
	}
	
	
//	/**
//	 * 根据部门查询该部门下的人员列表 参数 map deptids 中的KEY是“itemList” 的值为要查询部门ID的集合 add by zhanghao
//	 */
//	public List<SysUser> getUserByDept(Map deptids) {
//		List <SysUser> userList = sysUserDao.getUserByDept(deptids);
//		return userList;
//	}
//	/**
//	 * 根据部门编码查询该部门下及子部门下的所有人员。。。zhanghao
//	 */
//	public List<SysUser> getUserByCode(String deptCode){
//		List <SysUser> userList = sysUserDao.getUserByCode(deptCode);
//		return userList;
//	}
}
